<?php
require_once("../../class/connect.php");
require_once("../../class/db_sql.php");
require_once("../../class/q_functions.php");
require_once("../../class/user.php");
require_once("../../data/dbcache/MemberLevel.php");
$link=db_connect();
$empire=new mysqlquery();
$editor=1;

if(!$uid){
	$user=islogin();
	$user_id=$user[userid];
	$login_uid=$user_id;
}else{
	$user_id=$uid;
}

$r=ReturnUserInfo($user_id);

//$online=getUserOnLineList("1,2");
//print_r($online);
$user_name=$r['username'];
//print_r($r);
if(!$is_my){
	$focus=$empire->fetch1("select count(id) as num from phome_jat_focus where uid='".$lguserid."' AND t_uid='".$user_id."' AND type_id='".USR_FOCUS_ID."' limit 1");
	$is_focus=$focus[num]!=0?true:false;
}
$fsql="SELECT * FROM phome_jat_focus WHERE t_uid='{$user_id}' AND type_id='".USR_FOCUS_ID."' limit 6";
$fsc=$empire->query($fsql);
while($temp=$empire->fetch($fsc)){
	$arrFocus[]=$temp;
}
//var_dump($is_focus);
$addr=$empire->fetch1("select * from {$dbtbpre}enewsmemberadd where userid='".$user_id."' limit 1");
$visit=$empire->fetch1("select * from {$dbtbpre}ecms_visit  where uid='".$user_id."' limit 6");//访问记录；
//头像
$review=DbTouchAll('phome_ecms_actives',array('checked'=>1),"*","order by onclick desc limit 2");
$userpic=$addr['userpic']?$addr['userpic']:$public_r[newsurl].'e/data/images/nouserpic.gif';
//有效期
$userdate=0;
if(!$is_my){
	saveTrack($user_id);
}
$userTrack=getTrack($user_id);
if($r[userdate])
{
	$userdate=$r[userdate]-time();
	if($userdate<=0)
	{
		$userdate=0;
	}
	else
	{
		$userdate=round($userdate/(24*3600));
	}
}
//是否有短信息
$havemsg="无";
if($user[havemsg])
{
	$havemsg="<a href='".$public_r['newsurl']."e/member/msg' target=_blank><font color=red>您有新信息</font></a>";
}
//注册时间
$registertime=$r[registertime];
if($user_register)
{
	$registertime=date("Y-m-d H:i:s",$r[registertime]);
}
//导入模板
require(ECMS_PATH.'e/template/member/sp.php');
db_close();
$empire=null;
?>